#ifndef _LIST_HEAP_H
#define _LIST_HEAP_H
typedef void *ElementType;
struct HeapStruct;
struct Tree;

typedef struct Tree *Position;
typedef Position Tree;
typedef struct HeapStruct *PriorityQueue;
typedef int Index;
PriorityQueue Initialize();
void Destory(PriorityQueue H);
void MakeEmpty(PriorityQueue H);
void Insert(ElementType X, PriorityQueue H);
ElementType DeleteMin(PriorityQueue H);
ElementType FindMin(PriorityQueue H);
int IsEmpty(PriorityQueue H);
int IsFull(PriorityQueue H);

void _deleteTree(Tree T);

//如果我们有办法得知关键字的位置，那么下面的方法是有益的
void DecreaseKey(Index P, int Change, PriorityQueue H);
void IncreaseKey(Index P, int Change, PriorityQueue H);
void Delete(Index P, PriorityQueue);

struct Tree
{
    ElementType Element;
    int Priority;
    Position Left;
    Position Right;
};

struct HeapStruct
{
    int Size;
    Tree Tree;
};
#endif